import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const queryBizApparchSystem = (params) => {
  params.head.transCode = 'queryBizApparchSystem';
  return request({
    url: '/biz/apparch/bizApparchSystem/queryBizApparchSystem',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const queryBizApparchSystemListPage = (params) => {
  params.head.transCode = 'queryBizApparchSystemListPage';
  return request({
    url: '/biz/apparch/bizApparchSystem/queryBizApparchSystemListPage',
    method: 'post',
    data: params
  })
}
//查询系统关系列表，支持条件查询
export const queryBizApparchSystemRelationListPage = (params) => {
  params.head.transCode = 'queryBizApparchSystemRelationListPage';
  return request({
    url: '/biz/apparch/bizApparchSystem/queryBizApparchSystemRelationListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveBizApparchSystem = (params) => {
  params.head.transCode = 'saveBizApparchSystem';
  return request({
    url: '/biz/apparch/bizApparchSystem/saveBizApparchSystem',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveBizApparchSystemList = (params) => {
  params.head.transCode = 'saveBizApparchSystemList';
  return request({
    url: '/biz/apparch/bizApparchSystem/saveBizApparchSystemList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateBizApparchSystem = (params) => {
  params.head.transCode = 'saveOrUpdateBizApparchSystem';
  return request({
    url: '/biz/apparch/bizApparchSystem/saveOrUpdateBizApparchSystem',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateBizApparchSystemList = (params) => {
  params.head.transCode = 'saveOrUpdateBizApparchSystemList';
  return request({
    url: '/biz/apparch/bizApparchSystem/saveOrUpdateBizApparchSystemList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateBizApparchSystem = (params) => {
  params.head.transCode = 'updateBizApparchSystem';
  return request({
    url: '/biz/apparch/bizApparchSystem/updateBizApparchSystem',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteBizApparchSystem = (params) => {
  params.head.transCode = 'deleteBizApparchSystem';
  return request({
    url: '/biz/apparch/bizApparchSystem/deleteBizApparchSystem',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteBizApparchSystemList = (params) => {
  params.head.transCode = 'deleteBizApparchSystemList';
  return request({
    url: '/biz/apparch/bizApparchSystem/deleteBizApparchSystemList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportBizApparchSystemExcel = (params) => {
  downloadExcel({
    url: '/biz/apparch/bizApparchSystem/excelDownload/exportBizApparchSystemExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
